<!DOCTYPE HTML>
<html>
<head>
	<title>Contact</title>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css" media="all" />
	<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
	<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/static/layer/layer.js"></script>
</head>
<body>
	<include file="Common/header"/>
	<div class="work-top">
		<div class="wrap">
			<div class="single-left">
				<h1>联系我们</h1>
			</div>
			<div class="clear"></div>
		</div>
	</div>
	<div class="main">
		<div class="contact">
			<div class="wrap">
				<div class="section group example">
					<div class="col_1_of_2 span_1_of_2">
						<div class="contact-form">
							<form method="post" action="{:U('Index/getMsg')}">
								<div>
									<span><label>您的姓名：</label></span>
									<span><input name="name" id="name" type="text" class="textbox"></span>
								</div>
								<div>
									<span><label>您的E-Mail：</label></span>
									<span><input name="email" id="email" type="text" class="textbox"></span>
								</div>
								<div>
									<span><label>留言标题：</label></span>
									<span><input name="title" id="title" type="text" class="textbox"></span>
								</div>
								<div>
									<span><label>留言内容：</label></span>
									<span><textarea name="msg" id="msg"></textarea></span>
								</div>
								<div>
									<span><input type="submit" value="提交"></span>
								</div>
							</form>
						</div>
					</div>
					<div class="col_1_of_2 span_1_of_2">
						<h4 class="contact-head">我们在这儿</h4>
						<div class="map">
							<!-- 谷歌地图 -->
							<!-- <div class="map-border"><iframe width="100%" height="250" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.co.in/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Lighthouse+Point,+FL,+United+States&amp;aq=4&amp;oq=light&amp;sll=26.275636,-80.087265&amp;sspn=0.04941,0.104628&amp;ie=UTF8&amp;hq=&amp;hnear=Lighthouse+Point,+Broward,+Florida,+United+States&amp;t=m&amp;z=14&amp;ll=26.275636,-80.087265&amp;output=embed"></iframe><br><small><a href="https://maps.google.co.in/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=Lighthouse+Point,+FL,+United+States&amp;aq=4&amp;oq=light&amp;sll=26.275636,-80.087265&amp;sspn=0.04941,0.104628&amp;ie=UTF8&amp;hq=&amp;hnear=Lighthouse+Point,+Broward,+Florida,+United+States&amp;t=m&amp;z=14&amp;ll=26.275636,-80.087265" style="color:#666;text-align:left;font-size:12px"></a></small></div> -->
							<include file="Common/map"/>
						</div>
						<ul class="list3">
							<li>
								<img src="__PUBLIC__/images/location.png" alt=""/>
								<div class="company_address">
									<h3>公司信息 :</h3>
									<p>500 Lorem Ipsum Dolor Sit,</p>
									<p>22-56-2-9 Sit Amet, Lorem,</p>
									<p>中国&nbsp;.&nbsp;新乡</p>
									<p>电话:(00) 222 666 444</p>
									<p>传真: (000) 000 00 00 0</p>
									<p>邮箱: <span>info[at]bluebox.com</span></p>
								</div>
							</li>
						</ul>
					</div>
					<div class="clear"></div>
				</div>
			</div>
		</div>	
	</div>
	<include file="Common/footer"/>
	<script>
		$('form').submit(function(){
			var name  = $('#name').val();
			var email  = $('#email').val();
			var title = $('#title').val();
			var msg = $('#msg').val();
			if(name == ''){		
				layer.msg('姓名不能为空');
				return false;
			}
			if(email == ''){		
				layer.msg('邮箱不能为空');
				return false;
			}
			if(title == ''){		
				layer.msg('标题不能为空');
				return false;
			}
			if(msg == ''){		
				layer.msg('内容不能为空');
				return false;
			}
			//获取跳转路径也就是action的值。
			var url  = $(this).attr('action');
			console.log('url:',url)
			$.ajax({
				type:"post",	
				url :url,      
            data:{name,email,title,msg,},	//传递的参数
            success: function(res){	//回调函数
            	if(res.status){
            		layer.msg(res.message,{time:1000},function(){
            			window.location.href = "{:U('Index/contact')}";
            		});
            	}else{
            		layer.msg(res.message,{time:1000},function(){
            			window.location.href = "{:U('Index/index')}";
            		});
            	}
            }
        });
			return false;
		});
	</script>
</body>
</html>